require "table_for_helper/version"
require "table_for_helper/builder"

module TableForHelper
  # Creates a html table from a resource collection
  def table_for(resources, options = {}, &block)
    Builder.new(resources, options, &block).to_html
  end
end

ActionController::Base.class_eval do
  helper TableForHelper
end
